<template>
  <div>
    <p>The current mouse position is ({{ x }}, {{ y }})</p>
    <hr />
    <n-button :disabled="!!count" @click="buttonClick">{{
      count ? ` ${count} 秒后重试` : "获取验证码"
    }}</n-button>
  </div>
</template>

<script lang="ts" setup>
import useMouse from "./use-mouse";
import useDownCount from "./use-down-count";
const { x, y } = useMouse();
const { count, start } = useDownCount(5);

function buttonClick() {
  start();
}
</script>

<style scoped lang="less"></style>
